import pymysql
conn = pymysql.connect(host="localhost", user="root", password="12345678", database="mrsoft", charset="utf8")

cursor = conn.cursor()
cursor.execute("SELECT * FROM books where price < %s and year(publish_time) >= %s", (70,2017,))
result = cursor.fetchall()
print(result)
cursor.close()
conn.close()
for item in result:
  print('图书：《%s'%(item[1]) + '》，价格:￥%s'%(item[3]) + '元，出版日期：%s'%(item[4]))
    
    